package it.infodea.tapestrydea.pages.demodea;

import it.infodea.tapestrydea.support.annotations.AllowedExtensions;
import it.infodea.tapestrydea.support.annotations.PageInfo;
import it.infodea.tapestrydea.support.enumerations.SecurityGroup;

import java.util.Calendar;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.upload.services.UploadedFile;

@PageInfo(allowedSecurityGroup=SecurityGroup.ANONYMOUS, mode = PageInfo.MODE_NORMAL)
public class AjaxUploadDemoDea {
	
	@Property
	private UploadedFile file;
	
	private Bean bean;
	
	public String getDate(){
		return Calendar.getInstance().getTime().toString();
	}
	
	public Bean getBean() {
		return bean;
	}

	public void setBean(Bean bean) {
		this.bean = bean;
	}

	public static class Bean{
		private UploadedFile file;

		@AllowedExtensions(".pdf")
		public UploadedFile getFile() {
			return file;
		}
		
		public void setFile(UploadedFile file) {
			this.file = file;
		}
		
	}
	
	
}
